#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
using namespace std;

class Solution {
public:
    int findKthLargest(vector<int>& nums, int k) {
        priority_queue<int> Q;
        for(int i = 0;i<nums.size();++i){
            Q.push(nums[i]);
        }
        int result = 0;
        while(k>0){
            result = Q.top();
            Q.pop();
            --k;
        }
        return result;
    }
};